if pkg == root_pkg {
cx.compilation.cfgs.extend(output.cfgs.iter().cloned());
}
- let any_dylib = output.library_links.iter().any(|l| {
- !l.starts_with("static=") && !l.starts_with("framework=")
- });
- if !any_dylib && !output.library_links.is_empty() {
- continue
- }
for dir in output.library_paths.iter() {
cx.compilation.native_dirs.insert(pkg.clone(), dir.clone());
}
", running = RUNNING, compiling = COMPILING)));
});
+
+test!(doctest_recieves_build_link_args {
+ let p = project("foo")
+ .file("Cargo.toml", r#"
+ [project]
+ name = "foo"
+ version = "0.5.0"
+ authors = []
+ [dependencies.a]
+ path = "a"
+ "#)
+ .file("src/lib.rs", "")
+ .file("a/Cargo.toml", r#"
+ [project]
+ name = "a"
+ version = "0.5.0"
+ authors = []
+ links = "bar"
+ build = "build.rs"
+ "#)
+ .file("a/src/lib.rs", "")
+ .file("a/build.rs", r#"
+ fn main() {
+ println!("cargo:rustc-link-search=native=bar");
+ }
+ "#);
+
+ assert_that(p.cargo_process("test").arg("-v"),
+ execs().with_status(0)
+ .with_stdout_contains(&format!("\
+{running} `rustdoc --test [..] --crate-name foo [..]-L native=bar[..]`
+", running = RUNNING)));
+});